<!DOCTYPE html>
<html>

<head>
    <title>下载</title>
    <% include layout/lib.ejs %>
    <link rel="stylesheet" type="text/css" href="/css/download.css" />
</head>

<body>
    <% include layout/header.ejs %>

    <div class="downloadBox">
        <div class="downloadMain">
            <div class="downloadTitle" style="margin:0px;">Easy-D集合开发框架<span>更多版本，敬请期待...</span></div>
            <div class="downloadContent">
                <% for(var i=0;i<dataList.length;i++){ %>
                <% if(dataList[i].p_type == '0'){ %>
                <div class="downloadItem">
                    <div class="downloadName"><%= dataList[i].p_name %></div>
                    <div class="downloadVersion">
                        <a class="downloadZip" data-pid="<%= dataList[i].p_id %>" id="<%= dataList[i].p_url %>" href="#">立即下载<span>（ <i
                                    class="fa fa-cloud-download fa-lg"></i> 下载次数：<%= dataList[i].p_down_count %>
                                ）</span></a>
                    </div>
                </div>
                <% } %>
                <% } %>
                <div class="downloadItem">
                    <div class="downloadName">服务层开发框架</div>
                    <div class="downloadVersion"><a href="javascript:void(0)"
                            style="color:#ccc">立即下载（正在优化，敬请期待...）<span>（ <i class="fa fa-cloud-download fa-lg"></i> 0
                                ）</span></a></div>
                </div>
                <div class="downloadItem">
                    <div class="downloadName">电脑端开发框架</div>
                    <div class="downloadVersion"><a href="javascript:void(0)"
                            style="color:#ccc">立即下载（正在优化，敬请期待...）<span>（ <i class="fa fa-cloud-download fa-lg"></i> 0
                                ）</span></a></div>
                </div>
                <div class="downloadItem">
                    <div class="downloadName">微信端开发框架</div>
                    <div class="downloadVersion"><a href="javascript:void(0)"
                            style="color:#ccc">立即下载（正在优化，敬请期待...）<span>（ <i class="fa fa-cloud-download fa-lg"></i> 0
                                ）</span></a></div>
                </div>
                <div class="downloadItem"></div>
                <div class="downloadItem"></div>
            </div>
            <div class="downloadTitle">Easy-D微服务<span>更多版本，敬请期待...</span></div>
            <% for(var i=0;i<dataList.length;i++){ %>
            <% if(dataList[i].p_type == '1'){ %>
            <div class="downloadItem">
                <div class="downloadName"><%= dataList[i].p_name %></div>
                <div class="downloadVersion"><a data-pid="<%= dataList[i].p_id %>" class="downloadZip" href="#" id="<%= dataList[i].p_url %>">最新版本下载<em
                            style="font-style:normal;color:#999;">（基于服务层开发框架开发）</em><span>（ <i
                                class="fa fa-cloud-download fa-lg"></i> 下载次数：<%= dataList[i].p_down_count %>
                            ）</span></a></div>
            </div>
            <% } %>
            <% } %>


            <div class="downloadItem"></div>
            <div class="downloadItem"></div>


        </div>
    </div>

    <% include layout/footer.ejs %>
</body>
<script>
    $(function () {
        $(".downloadZip").click(function () {
            var downloadURL = $(this).attr("id");
            var a = document.createElement('a');
            a.setAttribute('href', downloadURL);
            a.setAttribute('id', 'startTelMedicine');
            if (document.getElementById('startTelMedicine')) {
                document.body.removeChild(document.getElementById('startTelMedicine'));
            }
            document.body.appendChild(a);
            a.click();

            var p_id = $(this).data("pid");
            //调用下载数量更新接口
            HTTP.get("/user/updateDownload?p_id="+p_id, (rs) => {})
        })
    })
</script>

</html>